<?

$fs_inv_ctl_items = new Fieldset (array (
	db_conn=>$_GLOBAL_DBH,
	relation=>"inv_ctl_items",
	title=>"Inventory Items",
	fieldset=>array (
		array (name=>"id",label=>"ID",type=>"numeric",
				value=>$_REQUEST["item_id"],
				input=>"hidden",primary_key=>true),
		array (name=>"category_id",label=>"Category",type=>"any",
				relation=>array(foreign=>"inv_ctl_categories",key=>"id",
				field=>"name"),
				input=>"select",
				options=>"_app_select_query",
				options_params=>"SELECT id,name FROM inv_ctl_categories",
				columns=>array (key=>"id",value=>"name"),
		),
		array (name=>"type_id",label=>"Type ID",type=>"any",
				relation=>array(foreign=>"inv_ctl_types",key=>"id",
				field=>"name"),
				input=>"select",
				options=>"_app_select_query",
				options_params=>"SELECT id,name FROM inv_ctl_types",
				columns=>array (key=>"id",value=>"name"),
		),
		array (name=>"markup_id",label=>"Mark-up",type=>"any",
				relation=>array(foreign=>"inv_ctl_markups",key=>"id",
				field=>"name"),
				input=>"select",
				options=>"_app_select_query",
				options_params=>"SELECT id,name FROM inv_ctl_markups",
				columns=>array (key=>"id",value=>"name"),
		),
		array (name=>"status_id",label=>"Status",type=>"any",
				relation=>array(foreign=>"inv_ctl_status",key=>"id",
				field=>"name"),
				input=>"select",
				options=>"_app_select_query",
				options_params=>"SELECT id,name FROM inv_ctl_status",
				columns=>array (key=>"id",value=>"name"),
		),
		array (name=>"name",label=>"Item Name",type=>"alphanumeric",
				input=>"field"),
		array (name=>"description",label=>"Description",type=>"alphanumeric",
				input=>"text"),
		array (name=>"make",label=>"Make",type=>"alphanumeric",
				input=>"input"),
		array (name=>"model",label=>"Model",type=>"alphanumeric",
				input=>"input"),
		array (name=>"serial",label=>"Serial",type=>"alphanumeric",
				input=>"input"),
		array (name=>"barcode",label=>"Barcode",type=>"alphanumeric",
				input=>"input"),
		array (name=>"unit_price",label=>"Unit Price",type=>"decimal",
				input=>"field"),
		array (name=>"date_entered",label=>"Date Entered",type=>"any",
				input=>"date",value=>_app_date("date_entered")),
		array (name=>"reorder_level",label=>"Reorder Level",type=>"numeric",
				input=>"input"),
		array (name=>"weight",label=>"Weight",type=>"decimal",
				input=>"input"),
		array (name=>"w_measure",label=>"Weight Measure",type=>"character",
                                input=>"select",
                                value=>"new",
                                options=>array (
                                        array (id=>"pt",name=>"Pints"),
                                        array (id=>"qt",name=>"Quart"),
                                        array (id=>"lt",name=>"Liter"),
                                        array (id=>"lt",name=>"Gallon"),
                                        array (id=>"oz",name=>"Ounces"),
                                        array (id=>"lb",name=>"Pound"),
                                ),
                                columns=>array(key=>"id",value=>"name"),
                ),
		array (name=>"height",label=>"Height",type=>"decimal",
				input=>"input"),
		array (name=>"depth",label=>"Depth",type=>"decimal",
				input=>"input"),
		array (name=>"width",label=>"Width",type=>"decimal",
				input=>"input"),
		array (name=>"d_measure",label=>"Dimension Measure",type=>"character",
                                input=>"select",
                                value=>"new",
                                options=>array (
                                        array (id=>"in",name=>"Inches"),
                                        array (id=>"ft",name=>"Feet"),
                                        array (id=>"yd",name=>"Yards"),
                                        array (id=>"mm",name=>"Millmeters"),
                                        array (id=>"cm",name=>"Centimeters"),
                                        array (id=>"dm",name=>"Decimeters"),
                                ),
                                columns=>array(key=>"id",value=>"name"),
                ),
	),
));

$fs_inv_ctl_items->parse ();

?>
